using AppToolKit.Model.Validation.Validator;
using System;
namespace AppToolKit.Model.Validation.Attribute
{
	[AttributeUsage(AttributeTargets.Property, AllowMultiple = true, Inherited = false)]
	public class DomainRuleAttribute : RuleAttribute
	{
		private string property_;
		private string domain_;
		public DomainRuleAttribute(string domain, string property, ValidateBehavior behavior) : base(behavior)
		{
			this.property_ = property;
			this.domain_ = domain;
		}
		public DomainRuleAttribute(string domain, string property) : this(domain, property, ValidateBehavior.Both)
		{
		}
		public override IValidator CreateVaildator()
		{
			return new DomainRuleValidator(this.domain_, this.property_);
		}
	}
}
